package com.xzc.apitest.checkPoint

import com.xzc.apitest.source.SensorReading
import org.apache.flink.streaming.api.scala._

object StateBackendTest {
  def main(args: Array[String]): Unit = {
    //创建执行环境
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    env.setParallelism(1)
    //默认是MemoryStateBackend
    //    env.setStateBackend(new FsStateBackend("11"))
    //    env.setStateBackend(new RocksDBStateBackend("123"))

    val inputStream = env.socketTextStream("hadoop102", 7777);

    val dataStream = inputStream
      .map(data => {
        val arr = data.split(",")
        SensorReading(arr(0), arr(1).toLong, arr(2).toDouble)
      })
  }

}
